package com.cardeira.sendsms.client.data;

import java.util.Date;



import com.google.gwt.user.client.rpc.IsSerializable;



public class SmsEntry implements IsSerializable {

	private String text;

	private String phoneNumber;

	private Date date;
	private SmsState state;
	private String id;
	private int stateID;
	private String appTime;

	private String day;

	private String clinica;

	private String patient;
	private String senderPhone;
	private String senderID;

	private String key;

	private String mnc;


	
	public SmsEntry()
	{
		
	}
	public SmsEntry(String text, String phoneNumber, String appTime, String day, String clinica) {
		super();
		this.text = text;
		this.phoneNumber = phoneNumber;
		this.setAppTime(appTime);
		this.day=day;
		this.clinica=clinica;
		state=SmsState.PENDENTE;
	}
	public void setText(String text) {
		this.text = text;
	}
	public String getText() {
		return text;
	}
	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}
	public String getPhoneNumber() {
		return phoneNumber;
	}
	public void setId(String id) {
		this.id = id;
		this.state = SmsState.ENVIADO;
	}
	public String getId() {
		return id;
	}
	public void setState(SmsState state) {
		this.state = state;
	}
	public SmsState getState() {
		switch (stateID)
		{
			case 0:
				return SmsState.PENDENTE;
			
			case 5:
			case 6:
			case 7:
			case 9:
			case 10:
			case 11:
			case 12:
				return SmsState.ERRO;
			case 1:
			case 2:
			case 3:
			case 8:
				return SmsState.ENVIADO;
			case 4:
				return SmsState.ENTREGUE;			
		}
		return state;
	}
	public void setDate(Date date) {
		this.date = date;
	}
	public Date getDate() {
		return date;
	}

	public void setStateID(int stateID) {
		this.stateID=stateID;		
		
	}	
	public int getStateID()
	{
		return stateID;
	}

	public void setAppTime(String appTime) {
		this.appTime = appTime;
	}

	public String getAppTime() {
		return appTime;
	}

	public String getDay() {
		return this.day;
	}

	public String getClinica() {
		return this.clinica;
	}

	public String getSenderPhone() {
		return senderPhone;
	}
	public void setClinica(String clinica2) {
		clinica=clinica2;
		
	}
	public void setDay(String day2) {
		day=day2;
		
	}
	public void setPatient(String patient) {
		this.patient=patient;
		
	}
	public String getPatient() {
		return patient;
	}
	public void setSenderPhone(String senderPhone2) {
		senderPhone=senderPhone2;
		
	}
	public void setSenderID(String senderID2) {
		senderID=senderID2;
		
	}
	public String getSenderID() {
		return senderID;
	}
	public void setKey(String key) {
		this.key=key;
		
	}
	public void setMNC(String mnc) {
		this.mnc=mnc;
		
	}
	public String getKey() {
		// TODO Auto-generated method stub
		return key;
	}		
}


